﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SEGIService
{
    public class SEGIException : Exception
    {
        /// <summary>
        /// 错误状态码
        /// </summary>
        public int ErrorCode { get; set; } = 666;

        /// <summary>
        /// 错误详情（可用于前端展示或日志记录）
        /// </summary>
        public object? ErrorData { get; set; }

        public SEGIException() { }
        public SEGIException(string message) : base(message) { }
        public SEGIException(string message, int errorCode) : base(message) => ErrorCode = errorCode;
        public SEGIException(string message, object errorData) : base(message) => ErrorData = errorData;
        public SEGIException(string message, int errorCode, object errorData)
            : base(message)
        {
            ErrorCode = errorCode;
            ErrorData = errorData;
        }
    }
}
